﻿/// Write a program that reads a string from the console and replaces all series of consecutive
/// identical letters with a single one.
/// Example: "aaaaabbbbbcdddeeeedssaa"  "abcdedsa".

using System;
using System.Collections.Generic;
using System.Text;


class zad23
{
    static void Main()
    {
        string strIn = "aaaaabbbbbcdddeeeedssaa";
        
        StringBuilder result = new StringBuilder();

        result.Append(strIn[0]);

        for (int i = 1; i < strIn.Length; i++)
        {
            if (strIn[i] != result[result.Length - 1])
            {
                result.Append(strIn[i]);
            }
        }

        Console.WriteLine(result);
    }

}

